package com.kun.config;

import com.kun.dao.BookDao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author fangkun
 * @create 2022-04-27-15:23
 */
@Configuration
@ComponentScan({"com.kun.service", "com.kun.dao", "com.kun.controller","com.kun.bean"})
public class MainConfigOfAutowired {

    @Primary
    @Bean("bookDao2")
    public BookDao bookDao() {
        BookDao bookDao = new BookDao();
        bookDao.setLable("2");
        return bookDao;
    }
}
